package com.central.apps.controller;

import com.central.apps.service.TremsService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@Api(tags = "测试controller")
@RequestMapping("/TremsMg")
public class TremsController {
    @Autowired
    TremsService TremsService;

    @PostMapping("/insertPuTrems")
    public String insertPuTrems(@RequestBody JSONObject Trems) throws Exception {

        String contractnum = (String) Trems.get("contractnum");
        String tremsnum = (String) Trems.get("tremsnum");
        return TremsService.insertPuTrems(contractnum,tremsnum);

    }
}
